package com.kangkangqing.controller;


import com.kangkangqing.domain.entity.Article;
import com.kangkangqing.domain.entity.ResponseResult;
import com.kangkangqing.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("article")
public class ArticleController {

    @Autowired
    private ArticleService articleService;

    @GetMapping("list")
    public List<Article> getList(){
        return articleService.list();
    }

    @GetMapping("hotArticleList")
    public ResponseResult<List> getHotArticleList(){
        return articleService.getHotArticleList();
    }

}
